<template>
  <div v-if="files.length > 0">
    <div v-for="item in files" :key="item.fileId" class="file-item">
      <div>{{ item.fileName }}</div>
      <FileDownload :fileUrl="item.fileUrl" :fileName="item.fileName" />
      <FilePreview :fileUrl="item.fileUrl" />
    </div>
  </div>
  <div v-else>无附件</div>
</template>
<script lang="ts" setup>
import FileDownload from './FileDownload.vue';
import FilePreview from './FilePreview.vue';
defineProps({
  files: {
    type: Array<any>,
    default: () => [],
  },
});
</script>
<style lang="scss" scoped>
.file-item {
  display: flex;
  & > div {
    margin-right: 10px;
  }
}
</style>
